package com.ruoyi.project.asset.assets.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.asset.assets.mapper.AssetsMapper;
import com.ruoyi.project.asset.assets.domain.Assets;
import com.ruoyi.project.asset.assets.service.IAssetsService;
import com.ruoyi.common.utils.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 资产Service业务层处理
 * 
 * @author xianzw
 * @date 2020-08-24
 */
@Service
public class AssetsServiceImpl  extends ServiceImpl<AssetsMapper, Assets>  implements IAssetsService 
{
    @Autowired
    private AssetsMapper assetsMapper;

    /**
     * 查询资产
     * 
     * @param id 资产ID
     * @return 资产
     */
    @Override
    public Assets selectAssetsById(Long id)
    {
        return assetsMapper.selectAssetsById(id);
    }

    /**
     * 查询资产列表
     * 
     * @param assets 资产
     * @return 资产
     */
    @Override
    public List<Assets> selectAssetsList(Assets assets)
    {
        return assetsMapper.selectAssetsList(assets);
    }

    /**
     * 新增资产
     * 
     * @param assets 资产
     * @return 结果
     */
    @Override
    public int insertAssets(Assets assets)
    {
        assets.setCreateTime(DateUtils.getNowDate());
        return assetsMapper.insertAssets(assets);
    }

    /**
     * 修改资产
     * 
     * @param assets 资产
     * @return 结果
     */
    @Override
    public int updateAssets(Assets assets)
    {
        assets.setUpdateTime(DateUtils.getNowDate());
        return assetsMapper.updateAssets(assets);
    }

    /**
     * 删除资产对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAssetsByIds(String ids)
    {
        return assetsMapper.deleteAssetsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除资产信息
     * 
     * @param id 资产ID
     * @return 结果
     */
    @Override
    public int deleteAssetsById(Long id)
    {
        return assetsMapper.deleteAssetsById(id);
    }
}
